1. Field of the Invention
The present invention relates to a data processing apparatus and method for encoding, multiplexing and outputting digitalized video and audio data, and a computer readable storage medium storing data processing programs realizing the data processing method.
2. Related Background Art
As international standards for a coding system of video, audio and other data, JPEG (Joint Photographic Coding Experts Group), H. 261 and MPEG (Moving Picture Coding Experts Group) which is an improved version of JPEG and H. 261 are known.
In the present days called a multimedia period collectively dealing with video, audio and other data, MPEG-1 as improved MPEG and further MPEG-2 as improved MPEG-1 are adopted.
Of these specifications, MPEG-2 is specifications which are recommended for transmitting video, audio and other data at a high quality in a limited transmission band. Equipments compatible with the specifications of MPEG-2 are in the main stream. For example, with MPEG-2, not only a desired number of respective encoded streams of video, audio and other data can be multiplexed into one stream (PS: Program Stream) as a set of programs, but also a plurality of programs can be constituted as one stream (TS: Transport Stream).
In a digital transmission apparatus compatible with the specifications of MPEG-2, an encoder unit of the apparatus encodes audio and video data and packetizes it into a PES (Packetized Elementary Stream which is again packetized into a TS packet and transmitted.
Packetizing will be specifically described by paying attention to audio data.
An audio data compression circuit of a digital transmission apparatus first compresses audio data in accordance with a predetermined scheme (e.g., ISO/IEC 11172-3), to form AAU's (Audio Access Units) each having a compression/expansion base unit and output an AES (Audio Elementary Stream) constituted of AAU's.
More specifically, as shown in FIG. 1A, AES constituted of AAU0, AAU1, . . . is output.
Next, as shown in FIG. 1B, AES is packetized in the unit of AAU, and a PTS (Presentation Time Stamp) is loaded in a header field (PES header) of each packet (PES packet). This packet as an audio PES is passed to the next process. According to ISO/IEC 13818-1, it stipulates that although it is not necessarily required to load PTS in each PES header, PTS is required to be loaded and transmitted at least once per 700 ms.
At the next process, as shown in FIG. 1C, each PES packet is further packetized into a transmission packet (TS packet) to make it have a fixed length size suitable for a transmission path. In order to make each packet have the same packet length, invalid data (staff data) is added if necessary as shown in FIG. 1C.
In a header field (TSP header) of a TS packet, a PID (Packet Identification) for identifying data (such as audio data and video data) stored in the packet, a PCR (Program Clock Reference) and the like are loaded. According to ISO/IEC 13818-1, it stipulates that although it is not necessarily required to load PCR in each TSP header, PCR is required to be loaded and transmitted at least once per 100 ms.
As above, audio data is transmitted as a TS packet.
AAU is the minimum unit which can be recovered independently, and is always constituted of data having a constant number of samples. Namely, AAU is constituted of data sampled during a predetermined period and having a fixed length preset for each compression factor.
PES including AAU's is packetized into each PES packet in the unit of AAU, and each PES packet is further packetized (divided) into a fixed length TS packet. In this case, it is not guaranteed that the data length of AAU, i.e., the data length of the PES packet, is an integer multiple of the data length of the TS packet. When each PES packet of PES is packetized and if the data of the PES packet is insufficient for the TS packet, the staff data is inserted into the last TS packet to make all TS packets have the same packet length.
As above, the data length of AAU (data length of the PES packet) has no definite relation to the data length of the TS packet and hence to the data length of the last TS packet. Therefore, the length of the staff data to be inserted so as to make the last TS packet have the fixed length is uncertain, which results in a reduction of the capacity of a transmission path.